package io1;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        String name="张三";
        int age=22;
        String gender="男";
        String[] otherInfo={"家住中国","手拿AK47","人当杀人，佛挡杀佛"};
        Student tta=new Student(name,age,gender,otherInfo);
        FileOutputStream fos=new FileOutputStream("Student.txt");
        ObjectOutputStream oos=new ObjectOutputStream(fos);
        oos.writeObject(tta);
        System.out.println("写入完毕");
        oos.close();
    }
}
